import request from '@/store/request'

/**
 * 列表查询接口
 * @param params
 */
export function loadArticleDatas(params) {
  return request({
    url: 'app/article/list',
    method: 'get',
    dataType: 'json',
    params: params
  })
}

/**
 * 详情查询接口
 * @param id
 */
export function loadArticleDetail(articleId) {
  return request({
    url: 'app/article/detail/' + articleId,
    method: 'get',
    dataType: 'json'
  })
}

export function addArticle(params) {
  return request({
    url: 'app/article/add',
    method: 'post',
    data: params,
    dataType: 'json'
  })
}

export function modifyStatus(articleId) {
  return request({
    url: 'app/article/edit/status/'+articleId,
    method: 'post',
    dataType: 'json'
  })
}

export function modifySetTop(articleId) {
  return request({
    url: 'app/article/edit/setTop/'+articleId,
    method: 'post',
    dataType: 'json'
  })
}

export function deleteArticle(articleId) {
  return request({
    url: 'app/article/delete/'+articleId,
    method: 'post',
    dataType: 'json'
  })
}
